﻿@model OLAP.Models.Partials.News
@{
    ViewBag.Title = "Pressrelease detail";
    Layout = null;
}

<article>
    <p class="date-time">
        @Model.Pressrelease.DateTime
    </p>

    <p class="press-titile">
        @Model.Pressrelease.Title
    </p>

    <p>
        @if (!string.IsNullOrEmpty(Model.Pressrelease.Message))
        {
            @Model.Pressrelease.Message
        }
    </p>
</article>
@{
    OLAP.Common.Utility util = new OLAP.Common.Utility();
}
<aside>
    <ul class="list-item">
        @foreach (OLAP.Models.Partials.Attachment item in @Model.Attachments)
        {
            if (Model.Pressrelease.SourceId == (int)OLAP.Common.SourceIds.FinanceReport)
            {
            <li>@Model.Pressrelease.Message</li>
            }
            else if (Model.Pressrelease.SourceId == (int)OLAP.Common.SourceIds.Tamtay)
            {
                string url = util.GetPictureUrl(item, 250);
                url = "~/" + url;
            <li class="item">
                <img src="@Url.Content(url)" alt="@Model.Pressrelease.Title" /></li>
            }
            else
            {
            <li class="item">
                <video width="640" height="560" controls autoplay="autoplay">
                    <source src="@Url.Action("Video", "Home", new { id = item.Id })" type="video/mp4">
                < /video></li>
            }
        }
    </ul>
</aside>
